﻿using System;
using System.Linq;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Text;
using System.Windows.Forms;

namespace MobileQuiz
{
    public partial class frmMain : Form
    {
        public frmMain()
        {
            InitializeComponent();
        }

        private void menuItemStart_Click(object sender, EventArgs e)
        {
            frmMultipleChoiceQuestion multipleChoiceQuestion = new frmMultipleChoiceQuestion();
            multipleChoiceQuestion.ShowDialog();
        }

        private void frmMain_Load(object sender, EventArgs e)
        {
            DataSet dataSet = new DataSet();
            // read quiz data file
            dataSet.ReadXml(@"\Program Files\MobileQuiz\quiz.xml");

            labelAlert.Text = dataSet.Tables["quiz"].Rows[0]["name"].ToString();
        }

        private void frmMain_KeyDown(object sender, KeyEventArgs e)
        {
            if ((e.KeyCode == System.Windows.Forms.Keys.Up))
            {
                // Up
            }
            if ((e.KeyCode == System.Windows.Forms.Keys.Down))
            {
                // Down
            }
            if ((e.KeyCode == System.Windows.Forms.Keys.Left))
            {
                // Left
            }
            if ((e.KeyCode == System.Windows.Forms.Keys.Right))
            {
                // Right
            }
            if ((e.KeyCode == System.Windows.Forms.Keys.Enter))
            {
                // Enter
            }

        }

        private void menuItemAbout_Click(object sender, EventArgs e)
        {
            frmAbout aboutForm = new frmAbout();
            aboutForm.ShowDialog();
        }

        private void menuItemExit_Click(object sender, EventArgs e)
        {
            this.Close();
        }
    }
}